<?php defined('SYSPATH') or die('No direct script access.'); ?>

<h2><?php echo 'Attributes for '.$category->name;?></h2>
<?php echo Form::open('admin/merchmanagement/attributes/add/'.$category->id); ?>
<?php echo Form::input('name', ''); ?>
<?php echo Form::submit('submit', 'Add Attribute');?>
<?php echo Form::close();?>
<br><br>

<?php foreach($attributes as $attribute) : ?>
<h3>
<?php echo $attribute->name; echo ' ';?>
<?php echo HTML::anchor('admin/merchmanagement/attributes/delete/'.$attribute->id, 'Delete');?>
</h3>
<table>
	<tr>
	<td>
	<?php echo Form::open('admin/merchmanagement/values/add/'.$attribute->id); ?>
	<?php echo Form::input('value', ''); ?>
	<?php echo Form::submit('submit', 'Add Value');?>
	<?php echo Form::close();?>
	</td>
	</tr>
	<?php foreach($attribute->values->find_all() as $value) :?>
	<tr>
	<td>
	<?php echo $value->value;?>
	<?php echo HTML::anchor('admin/merchmanagement/values/delete/'.$value->id, 'Delete')?>	
	<td>
	</tr>
	<?php endforeach; ?>
</table>

<?php endforeach; ?>
<?php echo HTML::anchor('admin/merchmanagement/', 'Back to categories')?>